* Add location of data here
cd ... 

log using "appendixFresults.txt", replace

use "affective-polarization_replication-files_prepared_data_telephone-demradar-wave8_v2.dta"

*** Appendix F. Assessing the level of affective polarization in Austria
* Data: Democracy Radar, Wave 8, Telephone data
svyset	[pweight=subset_gew_cut]

/*
tab f32_1, nol
gen oevpparty_symp=f32_1-1
gen spoeparty_symp=f32_2-1
gen fpoeparty_symp=f32_3-1

gen spoid=(f16==2)
gen fpoid=(f16==3)
gen ovpid=(f16==1)
gen othid=(f16>3&f16<10)
gen noid=(f15==2)|(f15==3)

gen id1=(ovpid==1)
gen id2=(spoid==1)
gen id3=(fpoid==1)

gen idcat=.
replace idcat=1 if ovpid==1
replace idcat=2 if spoid==1
replace idcat=3 if fpoid==1
replace idcat=4 if othid==1
replace idcat=5 if noid==1

gen spovote=(f13==2)
gen fpovote=(f13==3)
gen ovpvote=(f13==1)
gen othvote=(f13>3&f13<9)
gen novote=(f13==9|f13==10)

gen vote1=(ovpvote==1)
gen vote2=(spovote==1)
gen vote3=(fpovote==1)

gen votecat=.
replace votecat=1 if ovpvote==1
replace votecat=2 if spovote==1
replace votecat=3 if fpovote==1
replace votecat=4 if othvote==1
replace votecat=5 if novote==1

gen idvotecat=idcat
replace idvotecat=votecat if idcat==5&votecat!=.	

label define idvotecat_label ///
	1 "Party supporters: ÖVP" ///
	2 "Party supporters: SPÖ" ///
	3 "Party supporters: FPÖ" ///
	4 "Party supporters: Other" ///
	5 "Party supporters: None", replace
	
label values idvotecat idvotecat_label
*/

* Sympathy
* How sympathetic are ÖVP voters?
svy: mean oevpparty_symp if 	idvotecat==1 & quelle=="Telefon"
svy: mean oevpparty_symp if 	idvotecat==2 & quelle=="Telefon"
svy: mean oevpparty_symp if 	idvotecat==3 & quelle=="Telefon"	 
svy: mean oevpparty_symp if 	idvotecat==4 & quelle=="Telefon"
svy: mean oevpparty_symp if 	idvotecat==5 & quelle=="Telefon"	

* How sympathetic are SPÖ voters?
svy: mean spoeparty_symp if 	idvotecat==1 & quelle=="Telefon"
svy: mean spoeparty_symp if 	idvotecat==2 & quelle=="Telefon"
svy: mean spoeparty_symp if 	idvotecat==3 & quelle=="Telefon"	 
svy: mean spoeparty_symp if 	idvotecat==4 & quelle=="Telefon"
svy: mean spoeparty_symp if 	idvotecat==5 & quelle=="Telefon"	

* How sympathetic are FPÖ voters?
svy: mean fpoeparty_symp if 	idvotecat==1 & quelle=="Telefon"
svy: mean fpoeparty_symp if 	idvotecat==2 & quelle=="Telefon"
svy: mean fpoeparty_symp if 	idvotecat==3 & quelle=="Telefon"	 
svy: mean fpoeparty_symp if 	idvotecat==4 & quelle=="Telefon"
svy: mean fpoeparty_symp if 	idvotecat==5 & quelle=="Telefon"	

log close
